<div class="row-content layer-cf">
    <div class="row">
        <div class="layer-u-sm-12 layer-u-md-12 layer-u-lg-12">
            <div class="widget layer-cf">
                <div class="widget-head layer-cf">
                    <div class="widget-title layer-cf">评价列表</div>
                </div>
                <div class="widget-body layer-fr">
                    <div class="layer-scrollable-horizontal layer-u-sm-12">
                        <table width="100%" class="layer-table layer-table-compact layer-table-striped
                         tpl-table-black layer-text-nowrap">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th class="layer-text-center">用户</th>
                                <th>商品图片</th>
                                <th>商品名称</th>
                                <th>评分</th>
                                <th>评价内容</th>
                                <th>是否有图片</th>
                                <th>显示状态</th>
                                <th>评价排序</th>
                                <th>评价时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
							{if !$list->isEmpty()}{foreach $list as $item}
                          
                                <tr>
                                    <td class="layer-text-middle">{$item['comment_id']}</td>
                                    <td class="layer-text-center">
                                        <p class="">{$item['user']['nickName']}</p>
                                        <p class="layer-link-muted">(用户id：{$item['user']['user_id']})</p>
                                    </td>
                                    <td class="layer-text-middle">
                                        <a href="{$item['order_list']['image']['file_path']}"
                                           title="点击查看大图" target="_blank">
                                            <img src="{$item['order_list']['image']['file_path']}"
                                                 width="50" height="50" alt="商品图片">
                                        </a>
                                    </td>
                                    <td class="layer-text-middle">
                                        <p class="item-title">{$item['order_list']['name']}</p>
                                    </td>
                                    <td class="layer-text-middle">
                                        {if $item['score'] heq 10}
                                            <span class="x-color-green">好评</span>
                                        {elseif $item['score'] heq 20/}
                                            <span class="x-color-yellow">中评</span>
                                        {else/}
                                            <span class="x-color-red">差评</span>
                                        {/if}
                                    </td>
                                    <td class="layer-text-middle">
                                        <p class="item-title">{$item['content']}</p>
                                    </td>
                                    <td class="layer-text-middle">
                                       {if $item['is_picture']}
                                            <span class="x-color-green">是</span>
                                        {else/}
                                            <span class="">否</span>
                                        {/if}
                                    </td>
                                    <td class="layer-text-middle">
                                        {if $item['status']}
                                            <span class="x-color-green">显示</span>
                                       {else/}
                                            <span class="x-color-red">隐藏</span>
                                        {/if}
                                    </td>
                                    <td class="layer-text-middle">{$item['sort']}</td>
                                    <td class="layer-text-middle">{$item['create_time']}</td>
                                    <td class="layer-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="{:url('Item.comment/detail', ['comment_id' => $item['comment_id']])}">
                                                <i class="layer-icon-pencil"></i> 详情
                                            </a>
                                            <a href="javascript:void();"
                                               class="item-delete tpl-table-black-operation-del"
                                               data-id="{$item['comment_id']}">
                                                <i class="layer-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
								{/foreach}{else/}
                          
                                <tr>
                                    <td colspan="11" class="layer-text-center">暂无记录</td>
                                </tr>
                            {/if}
                            </tbody>
                        </table>
                    </div>
                    <div class="layer-u-lg-12 layer-cf">
                        <div class="layer-fr">{$list->render()|raw} </div>
                        <div class="layer-fr pagination-total layer-margin-right">
                            <div class="layer-vertical-align-middle">总记录：{$list->total()}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        // 删除元素
        var url = "{:url('item.comment/delete')}";
        $('.item-delete').delete('comment_id', url);
    });
</script>

